package com.jt.factory;

import org.springframework.beans.factory.FactoryBean;
import java.util.Calendar;

public class SpringFactory implements FactoryBean<Calendar> {

    //工厂模式实例化对象方法
    @Override
    public Calendar getObject() throws Exception {
        return Calendar.getInstance();
    }

    @Override
    public Class<?> getObjectType() {
        return Calendar.class;
    }

    //Spring容器中默认都是单例对象,多例对象
    @Override
    public boolean isSingleton(){
        return true;
    }

}
